package com.zhao.eduservice.controller;


import com.zhao.commonutils.R;
import com.zhao.eduservice.entity.EduVideo;
import com.zhao.eduservice.service.EduVideoService;
import org.apache.ibatis.annotations.Delete;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 课程视频 前端控制器
 * </p>
 *
 * @author test_java
 * @since 2022-10-18
 */
@RestController
@RequestMapping("/eduservice/video")
@CrossOrigin
public class EduVideoController {

    @Autowired
    private EduVideoService videoService;

    // 增加小节
    @PostMapping("addVideo")
    public R addVideo(@RequestBody EduVideo eduVideo) {
        videoService.save(eduVideo);
        return R.ok();
    }

    // 删除小节 删除小节中的视频
    @Delete("{id}")
    public R addVideo(@PathVariable String id) {
        videoService.removeById(id);
        return R.ok();
    }

    // 修改

}

